<extend name="./Common/View/Public/form.html" />
<block name="page_title">编辑指标</block>
<block name="main">
        <form class="layui-form" method="post" action="rate/norm/update" lay-filter="pageForm">
            <input type="hidden" value="{$data.id}" name="id" />
            <input type="hidden" value="{$data.tpl_id}" name="tpl_id" />
            <div class="layui-form-item">
                <label class="layui-form-label">所属模板</label>
                <div class="layui-input-block">
                   {$template.title}
                </div>
            </div>
            <if condition="!empty($template) AND $template['level'] gt 1">
                <div class="layui-form-item">
                    <label class="layui-form-label">上级指标</label>
                    <div class="layui-input-block">
                        <select name="pid" id="pid" lay-filter="pid" value="{$data.pid}" api="rate/norm/slist/pid/0/tpl_id/{$template.id}" empty="顶级指标"></select>
                    </div>
                </div>
                <else />
                <input type="hidden" name="pid" value="{$data.pid}" />
            </if>
            <div class="layui-form-item">
                <label class="layui-form-label">指标名称</label>
                <div class="layui-input-inline">
                    <input type="text" name="title" maxlength="50" minlength="1" value="{$data.title}" required lay-verify="required|length" placeholder="请输入指标名称" autocomplete="off" class="layui-input" />
                </div>
                <div class="layui-form-mid layui-word-aux">1-6个英文或汉字</div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">指标分数</label>
                <div class="layui-input-inline">
                    <input type="number" name="score" required lay-verify="required|number" value="{$data.score}" step="0.01" autocomplete="off" class="layui-input" />
                </div>
                <div class="layui-form-mid layui-word-aux">下级指标分数相加，不能大于上级指标</div>
            </div>
            <div class="layui-form-item">
                <div class="layui-inline">
                    <label class="layui-form-label">最低分</label>
                    <div class="layui-input-inline">
                        <input type="number" name="min" required lay-verify="required|number" value="{$data.min}" step="0.01" autocomplete="off" class="layui-input" />
                    </div>
                    <div class="layui-form-mid layui-word-aux">评分不能低于最低分</div>
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-inline">
                    <label class="layui-form-label">最高分</label>
                    <div class="layui-input-inline">
                        <input type="number" name="max" required lay-verify="required|number" value="{$data.max}" step="0.01" autocomplete="off" class="layui-input" />
                    </div>
                    <div class="layui-form-mid layui-word-aux">评分不能高于最高分</div>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">评分方式</label>
                <div class="layui-input-block">
                    {:W('Todo/Dict/radio',array('RATE_WAY','way',$data['way']))}
                </div>
            </div>
            <div class="layui-form-item layui-form-text">
                <label class="layui-form-label">评分标准</label>
                <div class="layui-input-block">
                    <textarea name="standard" placeholder="评分标准" class="layui-textarea">{$data.standard}</textarea>
                </div>
            </div>
            <div class="layui-form-item layui-form-text">
                <label class="layui-form-label">评分说明</label>
                <div class="layui-input-block">
                    <textarea name="remark" placeholder="评分说明" class="layui-textarea">{$data.remark}</textarea>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">展示排序</label>
                <div class="layui-input-inline">
                    <input type="number" name="sort" required lay-verify="required|int" value="{$data.sort}" autocomplete="off" class="layui-input" />
                </div>
                <div class="layui-form-mid layui-word-aux">从小到大排序</div>
            </div>
            <div class="layui-form-item">
                <div class="layui-input-block">
                    <button class="layui-btn" lay-submit lay-filter="pageForm">立即提交</button>
                    <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                </div>
            </div>
        </form>
    </block>